package com.ccloud.gen.engine.config;


import lombok.Data;

/**
 * @Version V1.0
 * @Project bigdata-cloud
 * @Title PageConfig
 * @Description 页面 模板生成的配置
 * @Package com.ccloud.gen.engine.config
 * @Date 2021/7/8 3:34 下午
 * @Copyright: 武汉大数据产业发展有限公司 All rights reserved.
 */
@Data
public class PageConfig {

    private ContextConfig contextConfig;

    private String pagePathTemplate;
    private String pageAddPathTemplate;
    private String pageEditPathTemplate;
    private String pageDetailPathTemplate;
    private String pageJsPathTemplate;
    private String pageInfoJsPathTemplate;

    public void init() {
        pagePathTemplate = "\\src\\main\\webapp\\WEB-INF\\view\\" + contextConfig.getModuleName() + "\\{}\\{}.html";
        pageAddPathTemplate = "\\src\\main\\webapp\\WEB-INF\\view\\" + contextConfig.getModuleName() + "\\{}\\{}_add.html";
        pageEditPathTemplate = "\\src\\main\\webapp\\WEB-INF\\view\\" + contextConfig.getModuleName() + "\\{}\\{}_edit.html";
        pageDetailPathTemplate = "\\src\\main\\webapp\\WEB-INF\\view\\" + contextConfig.getModuleName() + "\\{}\\{}_detail.html";
        pageJsPathTemplate = "\\src\\main\\webapp\\static\\modules\\" + contextConfig.getModuleName() + "\\{}\\{}.js";
        pageInfoJsPathTemplate = "\\src\\main\\webapp\\static\\modules\\" + contextConfig.getModuleName() + "\\{}\\{}_info.js";
    }

}
